package org.credo.socket;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class SocketA {

	public static void main(String[] args) throws IOException {
	}
	
	@SuppressWarnings({ "unused", "resource" })
	private void socketTest() throws IOException{
		//创建一个ServerSocket,用于监听客户端Socket的连接请求
		ServerSocket ss=new ServerSocket(30000);
		//采用循环不断的接受来自客户端的请求
		while(true){
			//每当接收到客户端Socket的请求时,服务端也对应产生一个Socket
			Socket s=ss.accept();
			//下面就可以使用Socket进行通信了...
		}
	}

}
